package net.mysoft.budgetsoft.system.domain;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Table(name="t_user")
@Entity
public class TUser extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7747801557230063680L;
	
	@Column(name="user_no", length=20)
	private String userNo;			//用户编号
	@Column(name="login_name", length=20)
	private String loginName;		//登录名
	private int sex;				//性别
	private int age;				//年龄
	private Date birthday;
	@Column(length=20)
	private String job;
	@Column(length=30)
	private String pwd;
	@Column(name="pwd_view", length=20)
	private String pwdView;
	@Column(length=20)
	private String tel;
	@Column(length=30)
	private String email;
	
	@ManyToOne(fetch=FetchType.LAZY)
	private TOrg org;//部门
	
	@ManyToMany(mappedBy="users")
	//@OrderBy("createDate desc")
	private List<TRole> roles;//该用户拥有的角色

	public String getUserNo() {
		return userNo;
	}
	public void setUserNo(String userNo) {
		this.userNo = userNo;
	}
	public int getSex() {
		return sex;
	}
	public void setSex(int sex) {
		this.sex = sex;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getJob() {
		return job;
	}
	public void setJob(String job) {
		this.job = job;
	}
	public String getPwd() {
		return pwd;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	public String getPwdView() {
		return pwdView;
	}
	public void setPwdView(String pwdView) {
		this.pwdView = pwdView;
	}
	public String getTel() {
		return tel;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public TOrg getOrg() {
		return org;
	}
	public void setOrg(TOrg org) {
		this.org = org;
	}
	public List<TRole> getRoles() {
		return roles;
	}
	public void setRoles(List<TRole> roles) {
		this.roles = roles;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public String getLoginName() {
		return loginName;
	}
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	
}
